package com.dataStructures.linearlist;

import org.junit.Before;
import org.junit.Test;

public class LinearListTest {
    private LinearList<String> strings;
    @Before
    public void setup(){
        strings = new LinearListImpl<String>();
    }

    @Test
    public void testInsert(){
        System.out.printf("list size : %d \n", strings.length());
        strings.addElement("test1");
        strings.addElement("test2");
        strings.addElement("test3");
        strings.addElement("test4");
        strings.addElement("test5");

        print();

        System.out.println(strings.length());

        int index = strings.index("test3");
        System.out.println("current index : = " + index);

        strings.delete(2);
        print();

        System.out.println("--------------------");

        strings.delete("test5");
        print();

        System.out.println("--------------------");
        strings.insert(3, "test6");
        print();





    }

    private void print(){
        for (int index = 0; index < strings.length(); index++){
            String value = String.valueOf(strings.get(index));
            System.out.println("value out : " + value);
        }
    }


}
